﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PPARTab.aspx.cs" Inherits="PPAP.Web.Part.PPARTab" %>

<%@ Register Assembly="PPAP.WebControls" Namespace="PPAP.WebControls" TagPrefix="cc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">
//        window.onbeforeunload = function () {
//            var txtFlag = document.getElementById("txtFlag");
//            //            var Button1 = document.getElementById("Button1");
//            if (txtFlag.value != "0") {
//                ////                window.event.returnValue = "Please ensure you have saved your PPAR information before leave this page; or please click cancel to save your PPAR information";
//                document.getElementById('Button2').click();
//                
//            }
        //        }

//window.setInterval(showalert, 3000); 
//function showalert() 
//{
//    var a = "<%=SavePPAR() %>";
//    alert('d');
//}

function check() {
    var txtSupplierPartNo = document.getElementById("txtSupplierPartNo");
    var txtSupplierPartName = document.getElementById("txtSupplierPartName");
    var txtModificationScope = document.getElementById("txtModificationScope");
    var txtRemarks = document.getElementById("txtRemarks");
    var txtDeliveredPartsQuantity = document.getElementById("txtDeliveredPartsQuantity");
    var txtDeliveryCourierCompany = document.getElementById("txtDeliveryCourierCompany");
    var dpDeliveryNoteDate1 = document.getElementById("dpDeliveryNoteDate1");
    var txtDeliveryNoteNumber = document.getElementById("txtDeliveryNoteNumber");
    var cbPPARWithoutSample = document.getElementById("cbPPARWithoutSample");
    var txtFlag = document.getElementById("txtFlag");
    if (txtSupplierPartNo.value == "") {
        alert(" 'Supplier part No.' for must fill in the item");
        txtSupplierPartNo.focus();
        return false;
    }
    if (txtSupplierPartName.value == "") {
        alert("'Supplier part name' for must fill in the item");
        txtSupplierPartName.focus();
        return false;
    }
    if (txtModificationScope.value == "") {
        alert("'Modification scope' for must fill in the item");
        txtModificationScope.focus();
        return false;
    }
    if (txtRemarks.value == "") {
        alert("'Remarks/explanations' for must fill in the item");
        txtRemarks.focus();
        return false;
    }

//    if (!cbPPARWithoutSample.checked) {
//        if (txtDeliveredPartsQuantity.value == "") {
//            alert("'Delivered parts quantity'  for must fill in the item");
//            txtDeliveredPartsQuantity.focus();
//            return false;
//        }

//        if (txtDeliveryCourierCompany.value == "") {
//            alert("'Delivery/courier company' for must fill in the item");
//            txtDeliveryCourierCompany.focus();
//            return false;
//        }
//        if (dpDeliveryNoteDate1.value == "") {
//            alert("'Delivery note date' for must fill in the item");
//            dpDeliveryNoteDate1.focus();
//            return false;
//        }
//        if (txtDeliveryNoteNumber.value == "") {
//            alert("'Delivery note number' for must fill in the item");
//            txtDeliveryNoteNumber.focus();
//            return false;
//        }
//    }
    // txtFlag.value = 0;
    return confirm('Are you sure you want to save?');

}
    </script>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body style="overflow-x: hidden; font-family: Arial, Helvetica, sans-serif;" runat="server" id="body" >

            
    <form id="form1" runat="server">
    <div><asp:ScriptManager ID="ScriptManager1"  runat="server">
            </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
        <table width="100%">
            <tr>
                
                <td style="width: 19%; font-weight: bold; color: #2E8AC5;">
                    Supplier part No.
                </td>
                <td style="width: 29%;">
                    <asp:TextBox autocomplete="off"   ID="txtSupplierPartNo" runat="server" Width="205px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <%--<input type="text" id="txtSupplierPartNo" style="width:205px;" runat="server" />--%>
                    <font color="red">*</font></td>
                <td style="width: 19%; font-weight: bold; color: #2E8AC5;">
                    Supplier part name
                </td>
                <td style="width: 33%;">
                    <asp:TextBox autocomplete="off"   ID="txtSupplierPartName" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
            </tr>
            <tr style="border: 1px; border-style: solid; border-color: Gray;">
                <td style="font-weight: bold; color: #2E8AC5; color: #2E8AC5;">
                    Plant
                </td>
                <td>
                    <asp:DropDownList ID="ddlPlant" runat="server" Width="205px" Enabled="False" CssClass="select" 
                        onselectedindexchanged="txtSupplierPartNo_TextChanged">
                    </asp:DropDownList>
                    <font color="red">*</font></td>
                <td style="font-weight: bold; color: #2E8AC5; color: #2E8AC5;">
                    Reason for sampling
                </td>
                <td>
                    <asp:RadioButton ID="rboInitialSampling" runat="server" Checked="True" GroupName="r"
                        Text="Initial sampling" AutoPostBack="True" OnCheckedChanged="rboInitialSampling_CheckedChanged" />
                    <asp:RadioButton ID="rboOtherSamples0" runat="server" GroupName="r" Text="Re-submission"
                        AutoPostBack="True" OnCheckedChanged="rboInitialSampling_CheckedChanged" />
                    <br />
                    <asp:DropDownList ID="ddlInitialSampling" runat="server" Width="265px">
                    </asp:DropDownList>
                    <font color="red">*</font><br />
                    <asp:RadioButton ID="rboOtherSamples" runat="server" GroupName="r" Text="Other samples"
                        AutoPostBack="True" OnCheckedChanged="rboInitialSampling_CheckedChanged" />
                    <br />
                    <asp:DropDownList ID="ddlOtherSamples" runat="server" Width="265px">
                    </asp:DropDownList>
                    <br />
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Q/E level
                </td>
                <td colspan="3">
                    <asp:DropDownList ID="ddlLevel" runat="server">
                        <asp:ListItem>Q</asp:ListItem>
                        <asp:ListItem>E</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Part/image/u504_normal.jpg" style="vertical-align: text-bottom; border:0px;"
                        OnClick="ImageButton1_Click" />
                    <asp:TextBox autocomplete="off"   ID="txtQLevel" runat="server" Width="125px" Enabled="False"></asp:TextBox>
                    <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Part/image/u506_normal.jpg" style="vertical-align: text-bottom; border:0px;"
                        OnClick="ImageButton2_Click" />
                    <font color="red">*</font></td>
            </tr>
            <tr>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Modification scope
                </td>
                <td style=" vertical-align:middle;">
                    <asp:TextBox autocomplete="off"   ID="txtModificationScope" runat="server" Height="84px" Width="205px"
                         TextMode="MultiLine"  style="word-wrap : break-word;word-break: break-all; overflow:hidden; " BackColor="White" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Remarks/explanations
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtRemarks" runat="server" Height="84px" Width="265px"  TextMode="MultiLine"  style="word-wrap : break-word;word-break: break-all; overflow:hidden; "
                        BackColor="White" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
            </tr>
        </table>
        <hr />
        <table width="100%">
            <tr>
                <td colspan="4" style="height: 30px; background-color: #FFFFCC">
                    <img src="../Images/newimg/tishi.png" style="vertical-align: middle;" /> only applicable for ECU or part with ECU
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold; color: #2E8AC5; width: 19%;">
                    ECU HW Version No.
                </td>
                <td style="width: 29%;">
                    <asp:TextBox autocomplete="off"   ID="txtECUHW" runat="server" width="205px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                </td>
                <td style="font-weight: bold; color: #2E8AC5; width: 19%;">
                    ECU SW Version No.
                </td>
                <td style="width: 33%;">
                    <asp:TextBox autocomplete="off"   ID="txtECUSW" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                </td>
            </tr>
        </table>
        <hr />
        <table width="100%">
            <tr>
                <td colspan="4" style="height: 30px; background-color: #FFFFCC">
                    <img src="../Images/newimg/tishi.png" style="vertical-align: middle;" /> only applicable for press parts/BiW
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold; color: #2E8AC5; width: 19%;">
                    Press part / Month of<br />
                    production
                </td>
                <td style="width: 29%;">
                    <asp:DropDownList ID="ddlYear" runat="server">
                        <asp:ListItem>2010</asp:ListItem>
                        <asp:ListItem>2011</asp:ListItem>
                        <asp:ListItem>2012</asp:ListItem>
                        <asp:ListItem>2013</asp:ListItem>
                        <asp:ListItem>2014</asp:ListItem>
                        <asp:ListItem>2015</asp:ListItem>
                        <asp:ListItem>2016</asp:ListItem>
                        <asp:ListItem>2017</asp:ListItem>
                        <asp:ListItem>2018</asp:ListItem>
                        <asp:ListItem>2019</asp:ListItem>
                        <asp:ListItem>2020</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;<asp:DropDownList ID="ddlMonth" runat="server">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                        <asp:ListItem>8</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>11</asp:ListItem>
                        <asp:ListItem>12</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td style="font-weight: bold; color: #2E8AC5; width:19%">
                    Press part / Press cycle
                </td>
                <td style="width: 33%;">
                    <asp:TextBox autocomplete="off"   ID="txtPressPartPressCycle" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Press part / Nest marking
                    </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtPressPartMarkingNest" runat="server" Width="205px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                </td>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Press part / Revision<br />
                    number
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtPressPartRevisionNumber" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                </td>
            </tr>
        </table>
        <hr />
        <table width="100%">
            <tr>
                <td colspan="4">
                    <asp:CheckBox ID="cbPPARWithoutSample" runat="server" Text="PPAR without sample"
                        AutoPostBack="True" ForeColor="#2E8AC5" OnCheckedChanged="cbPPARWithoutSample_CheckedChanged" />
                </td>
            </tr>
            <tr runat="server" id="tr1">
                <td style="font-weight: bold; color: #2E8AC5; width: 19%;">
                    Delivered parts quantity
                </td>
                <td style="width: 29%;">
                    <asp:TextBox autocomplete="off"   ID="txtDeliveredPartsQuantity" runat="server" Width="205px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
                <td style="font-weight: bold; color: #2E8AC5; width: 19%;">
                    Delivery/courier company
                </td>
                <td style="width: 33%;">
                    <asp:TextBox autocomplete="off"   ID="txtDeliveryCourierCompany" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
            </tr>
            <tr runat="server" id="tr2">
                <td style="font-weight: bold; color: #2E8AC5;">
                    Delivery note date
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="dpDeliveryNoteDate1" runat="server" Width="205px" 
                        onclick="WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d',maxDate:'2099-12-20'});" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
                <td style="font-weight: bold; color: #2E8AC5;">
                    Delivery note number
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtDeliveryNoteNumber" runat="server" Width="265px" 
                        ontextchanged="txtSupplierPartNo_TextChanged"></asp:TextBox>
                    <font color="red">*</font></td>
            </tr>
        </table>
        <hr />
        <table width="100%">
            <tr>
                <td align="center">
                    <asp:Button ID="Button1" runat="server" Text="Save" CssClass="button" OnClick="Button1_Click"
                        OnClientClick="return check();" />
                        <input type="hidden" id="txtFlag" value="1" /> 
                </td>
            </tr>
        </table>
        </ContentTemplate>
        <Triggers><asp:AsyncPostBackTrigger ControlID="txtSupplierPartNo" /></Triggers>
                </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
